#include <bits/stdc++.h>
using namespace std;
const int maxm = 1e5+10;
int A[maxm], B[maxm];

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
    int T; cin >> T;
    while(T--){
        int  N, M; cin >> N >> M;
        int maxa = 0, maxb = 0;
        for (int i = 0; i < M; ++i) {
            cin >> A[i] >> B[i];
            maxa = max(maxa, A[i]);
            maxb = max(maxb, A[i]);
        }

    }
    return 0;
}